<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    const data = [
  {
    入职日期: 44505,
    姓名: '小张',
    工号: '9002',
    手机号: '13800000252',
    转正日期: 44892,
    部门: '总裁办'
  },
  {
    入职日期: 44506,
    姓名: '小李',
    工号: 9006,
    手机号: '13810000512',
    转正日期: 44893,
    部门: '总裁办'
  }

]
function toEn(arr) {
  const mapInfo = {
    '入职日期': 'timeOfEntry',
    '手机号': 'mobile',
    '姓名': 'username',
    '转正日期': 'correctionTime',
    '工号': 'workNumber',
    '部门': 'departmentName',
    '聘用形式': 'formOfEmployment'
  }
  const result = arr.map(item => {
    const enObj = {}
    const zhKeys = Object.keys(item)
    zhKeys.forEach(zhKey => {
      enObj[mapInfo[zhKey]] = item[zhKey]
    })
    return enObj
  })
  return result
}
console.log(toEn(data))
  </script>
</head>
<body>

</body>
</html>
